package com.novacloud.fresh.controller.sys;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

/**
 * @param
 * @author <a href="mailto:huzhanjun@novacloud.com">huzj</a>
 * @version : 1.0
 * @date 2016-01-04 16:47
 */
@Controller
@RequestMapping(value = "/sys")
public class SysLoginController {
//
//    @Autowired
//    private SysUserService sysUserService;
//
//    @RequestMapping(value = "/login.html")
//    public ModelAndView login() {
//        return new ModelAndView("sys/sys-login");
//    }
//
//    @RequestMapping(value = "/logincheck.html")
//    public ModelAndView logincheck(HttpSession session, SysUser sysUser, ModelMap modelMap){
//
//        SysUser user = sysUserService.getByUserName(sysUser.getUsername());
//        if(user != null  &&user.getPassword()!=null && user.getPassword().equals(sysUser.getPassword())){
//            session.setAttribute("sysname",user.getUsername());
//            return  new ModelAndView("sys/sys-success",modelMap);
//        }else{
//            return  new ModelAndView("sys/sys-login",modelMap);
//        }
//
//    }
//    @RequestMapping(value = "/loginout.html")
//    public ModelAndView loginout(HttpSession session){
//         session.invalidate();
//        return new ModelAndView("sys/sys-login");
//    }
}
